package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.YouxuanGoodsPreferentialMapper;
import com.ruoyi.system.domain.YouxuanGoodsPreferential;
import com.ruoyi.system.service.IYouxuanGoodsPreferentialService;

/**
 * 商品优惠管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-01-03
 */
@Service
@DataSource(DataSourceType.SLAVE)
public class YouxuanGoodsPreferentialServiceImpl implements IYouxuanGoodsPreferentialService 
{
    @Autowired
    private YouxuanGoodsPreferentialMapper youxuanGoodsPreferentialMapper;

    /**
     * 查询商品优惠管理
     * 
     * @param id 商品优惠管理ID
     * @return 商品优惠管理
     */
    @Override
    public YouxuanGoodsPreferential selectYouxuanGoodsPreferentialById(Long id)
    {
        return youxuanGoodsPreferentialMapper.selectYouxuanGoodsPreferentialById(id);
    }

    /**
     * 查询商品优惠管理列表
     * 
     * @param youxuanGoodsPreferential 商品优惠管理
     * @return 商品优惠管理
     */
    @Override
    public List<YouxuanGoodsPreferential> selectYouxuanGoodsPreferentialList(YouxuanGoodsPreferential youxuanGoodsPreferential)
    {
        return youxuanGoodsPreferentialMapper.selectYouxuanGoodsPreferentialList(youxuanGoodsPreferential);
    }

    /**
     * 新增商品优惠管理
     * 
     * @param youxuanGoodsPreferential 商品优惠管理
     * @return 结果
     */
    @Override
    public int insertYouxuanGoodsPreferential(YouxuanGoodsPreferential youxuanGoodsPreferential)
    {
        return youxuanGoodsPreferentialMapper.insertYouxuanGoodsPreferential(youxuanGoodsPreferential);
    }

    /**
     * 修改商品优惠管理
     * 
     * @param youxuanGoodsPreferential 商品优惠管理
     * @return 结果
     */
    @Override
    public int updateYouxuanGoodsPreferential(YouxuanGoodsPreferential youxuanGoodsPreferential)
    {
        return youxuanGoodsPreferentialMapper.updateYouxuanGoodsPreferential(youxuanGoodsPreferential);
    }

    /**
     * 批量删除商品优惠管理
     * 
     * @param
     * @return 结果
     */
    @Override
    public int deleteYouxuanGoodsPreferential(YouxuanGoodsPreferential youxuanGoodsPreferential)
    {
        return youxuanGoodsPreferentialMapper.deleteYouxuanGoodsPreferential(youxuanGoodsPreferential);
    }

    /**
     * 删除商品优惠管理信息
     * 
     * @param id 商品优惠管理ID
     * @return 结果
     */
    @Override
    public int deleteYouxuanGoodsPreferentialById(Long id)
    {
        return youxuanGoodsPreferentialMapper.deleteYouxuanGoodsPreferentialById(id);
    }
}
